<?php
namespace app\common\validate;

use think\Validate;

class CmsContentValidate extends Validate
{
    // 验证规则
    protected $rule = [
        'title|文章标题'       => 'require',
        'cid|网站栏目'         => 'require',
        'content|内容'       => 'require',
        'redirecturl|转向链接' => 'url',
        'sort|排序'          => 'number',
    ];
    //验证场景
    protected $scene = [
        'add'  => ['title', 'cid', 'redirecturl', 'sort', 'content'],
        'edit' => ['title', 'cid', 'redirecturl', 'sort'],
    ];
}